<template>
  <div class="detail">
    <c-section title="基本信息">
      <!--   <template v-slot:right>
          <c-abnormal-preview path="/storeConstruction/exceptionManage" :query="{ constCode: detail.constCode, functionModel: 'SHOP_DECORATION' }" />
        </template> -->
      <c-list :column="3">
        <c-list-item label="门店建设项目号" :value="detail.constCode" />
        <c-list-item label="门店建设状态" :value="detail.constState" dict-type-code="CONST_STATE" />
        <c-list-item label="装修任务号" :value="detail.decorationTaskCode" />
        <c-list-item
          label="装修进度"
          dict-type-code="DECORATION_SCHEDULE"
          :value="detail.decorationSchedule"
        />
        <c-list-item
          label="装修步骤"
          dict-type-code="SHOP_DECORATION_STEPS"
          :value="detail.decorationStep"
        />
        <c-list-item
          label="装修状态"
          dict-type-code="SHOP_DECORATION_STATE"
          :value="detail.decorationStatus"
        />
        <c-list-item label="进场时间" :value="detail.actualApproachTime" />
        <c-list-item label="门店编码" :value="detail.shopCode" />
        <c-list-item label="门店" :value="detail.shopName" />
        <c-list-item label="业务账号编码" :value="detail.bizCode" />
        <c-list-item label="业务账号名称" :value="detail.bizName" />
      </c-list>
    </c-section>
    <c-section v-if="!isCurtainPge" title="色板任务信息">
      <c-list :column="3">
        <c-list-item
          label="色板任务号"
          :value="detail.colorTaskCode"
        />
        <c-list-item
          label="色板任务进度"
          dict-type-code="SWATCHES_PROGRESS"
          :value="detail.colorSchedule"
        />
        <c-list-item
          label="是否需要新店色板包"
          dict-type-code="BOOLEANS"
          :value="detail.isNewShopColor"
        />
        <c-list-item
          label="需求色板类型"
          dict-type-code="SWATCHES_TYPE"
          :value="detail.colorType"
        />
        <c-list-item
          label="色板需求明细"
          dict-type-code="SWATCHES_DETAIL"
          :value="detail.colorDefiniteDetailed"
        />
        <c-list-item
          label="是否需要工法展板"
          :value="detail.isDisplayBoard=='1'?'是' :'否'"
        />
        <c-list-item
          label="需求内框尺寸"
          dict-type-code="SWATCHES_SIZE"
          :value="detail.innerSize"
        />
      </c-list>
    </c-section>
    <c-section v-else title="窗帘任务信息">
      <c-list :column="2">
        <c-list-item
          label="窗帘任务号"
          :value="detail.colorTaskCode"
        />
        <c-list-item
          label="窗帘任务进度"
          dict-type-code="SWATCHES_PROGRESS"
          :value="detail.colorSchedule"
        />
        <c-list-item
          label="是否需要窗帘物料"
          :value="detail.isCurtain?'是':detail.isCurtain===0?'否':detail.isCurtain"
        />
        <c-list-item
          label="窗帘展示区内框尺寸"
          dict-type-code="CURTAIN_SIZE"
          :value="detail.curtainSize"
        />
        <c-list-item
          label="窗帘样本6QR20078001"
          :value="detail.curtainSamples?'是':detail.curtainSamples===0?'否':detail.curtainSamples"
        />
        <c-list-item
          label="轨道五金包6QR20077001"
          :value="detail.railHardware?'是':detail.railHardware===0?'否':detail.railHardware"
        />
      </c-list>
    </c-section>
    <c-section :title="!isCurtainPge?'色板任务审核信息':'窗帘任务审核信息'">
      <c-list :column="1">
        <c-list-item
          label="审核结果"
          :value="detail.auditResult=='1'?'同意':(detail.auditResult=='0'?'不同意':detail.auditResult)"
        />
      </c-list>
      <c-list :column="1">
        <c-list-item
          label="审核备注"
          :value="detail.auditRemark"
          :span="1 / 3"
        />
      </c-list>
    </c-section>
  </div>
</template>

<script>
import {
  getGetOneByid
} from '@/api/colorNeed'
export default {
  name: 'ColorNeedDetail',
  data() {
    return {
      detail: {
      },
      isCurtainPge: 0
    }
  },
  created() {
    this.getDetail()
  },
  methods: {

    getDetail() {
      const { id, isCurtain, isCurtainPge, curtainSize, curtainSamples, railHardware } = this.$route.query
      this.isCurtainPge = isCurtainPge
      if (!id) return
      getGetOneByid(id).then((res) => {
        this.detail = { ... res.data, isCurtain, curtainSize, curtainSamples, railHardware }
      })
      // })
    },
    goBack() {
      this.$router.go(-1)
    },
    toDetail(row) {
      this.$router.push({ name: 'ShopDrawingDetail', query: { id: row.id }})
    }
  }
}
</script>
<style lang="scss" scoped>
.detail {
}
</style>
